//package com.gitlab.lucky.admin.web.controller;
//
//import com.gitlab.lucky.common.dao.model.PlatformData;
//import com.gitlab.lucky.common.enums.CodeEnum;
//import com.gitlab.lucky.common.enums.Constant;
//import com.gitlab.lucky.common.result.R;
//import com.gitlab.lucky.common.service.PlatformDataService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.*;
//import tk.mybatis.mapper.entity.Example;
//
//import java.util.List;
//
///**
// * @program: lucky
// * @author: Mr.Han
// * @create: 2019-04-19 14:55
// **/
//@Controller
//@RequestMapping("api/admin")
//public class LoginController {
//    @Autowired
//    private PlatformDataService platformDataService;
//    @GetMapping("login")
//    public String login(){
//        return "/admin/login";
//    }
//    @GetMapping("index")
//    public String index(){
//        return "/admin/index";
//    }
//    @PostMapping("login")
//    @ResponseBody
//    public R login(PlatformData platformData){
//        Example example = new Example(PlatformData.class);
//        example.createCriteria().andEqualTo("appId",platformData.getAppId()).andEqualTo("isDelete", Constant.FALSE);
//        List<PlatformData> platformData1 = platformDataService.selectByExample(example);
//        if(platformData1==null||platformData1.size()<=0){
//            return R.error(CodeEnum.LOGIN_FAIL);
//        }
//        PlatformData platformData2 = platformData1.get(0);
//        if(platformData2.getAppSceart().equals(platformData.getAppSceart())){
//            return R.ok().data(platformData1.get(0));
//        }
//        return R.error(CodeEnum.LOGIN_FAIL);
//    }
//}
